package org.shuma.record.service.impl;

import com.alipay.sofa.runtime.api.annotation.SofaService;
import com.alipay.sofa.runtime.api.annotation.SofaServiceBinding;
import org.shuma.record.domain.entity.OperationRecord;
import org.shuma.record.domain.vo.OperationRecordVO;
import org.shuma.record.facade.RecordsFacade;
import org.shuma.record.mapper.OperationRecordMapper;
import org.shuma.record.service.IOperationRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author WangJunhe
 * @since 2024-06-18
 */
@Service
@SofaService(interfaceType = RecordsFacade.class, uniqueId = "${service.unique.id}", bindings = {@SofaServiceBinding(bindingType = "bolt")})
public class OperationRecordServiceImpl extends ServiceImpl<OperationRecordMapper, OperationRecord> implements IOperationRecordService, RecordsFacade {
    @Override
    public boolean addRecord(OperationRecordVO operationRecordVO) {
        OperationRecord operationRecord = new OperationRecord();
        BeanUtils.copyProperties(operationRecordVO,operationRecord);
        save(operationRecord);
        return true;
    }
}
